package gmomo.packet;

import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;

public class Invitation {
	
	private Message msg;
	
	public Invitation(String to) {
		msg = new Message(to, Message.Type.chat);
		msg.setProperty("GMoMoType", "invitation");
	}
	
	public Invitation(Message msg) {
		this.msg = msg;
	}
	
	public String getFrom() {
		return msg.getFrom();
	}
	
	public void setBody(String body) {
		msg.setBody(body);
	}
	
	public String getBody() {
		return msg.getBody();
	}
	
	public void setHost(String host) {
		msg.setProperty("host", host);
	}
	
	public String getHost() {
		return (String)msg.getProperty("host");
	}
	
	public void setPort(int port) {
		msg.setProperty("port", port);
	}
	
	public int getPort() {
		Integer port = (Integer)msg.getProperty("port");
		return port==null?-1:port;
	}
	
	public Packet getPacket() {
		return msg;
	}
	
}//end of class Invitation
